from OpenGL.GL import *


class Texture(object):

  def __init__(self):
    self.texture = glGenTextures(1)

  def bind(self, target=GL_TEXTURE_2D):
    glBindTexture(target, self.texture)

  def set_option(self, option, value, target=GL_TEXTURE_2D):
    self.bind(target)
    glTexParameter(target, option, value)

  def set_options(self, options, target=GL_TEXTURE_2D):
    self.bind(target)
    for option, value in options.iteritems():
      glTexParameter(target, option, value)
